<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/blog/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="python,pdf," />








  <link rel="shortcut icon" type="image/x-icon" href="/blog/favicon.ico?v=5.1.0" />






<meta name="description" content="今天一同学问我能不能帮他把pdf转word。我第一反应是告诉他有很多这样的线上工具，然后他告诉我说线上的转换工具只能转1页，剩下的要钱。呜呜呜~~。好吧，看看万能的python有什么库能帮助这位小哥哥。 果然我找到了一个库，可以将pdf中的文字写入到word中，只是格式略丑。但聊胜于无么。 pdf转word——文字版加入一个pdf是由文字组成的，我在网上找到了pdfminer3k这个模块来处理pd">
<meta name="keywords" content="python,pdf">
<meta property="og:type" content="article">
<meta property="og:title" content="python 解析pdf内容">
<meta property="og:url" content="https://gitee.com/shuhao/2018/03/30/python-解析pdf内容/index.html">
<meta property="og:site_name" content="Niki">
<meta property="og:description" content="今天一同学问我能不能帮他把pdf转word。我第一反应是告诉他有很多这样的线上工具，然后他告诉我说线上的转换工具只能转1页，剩下的要钱。呜呜呜~~。好吧，看看万能的python有什么库能帮助这位小哥哥。 果然我找到了一个库，可以将pdf中的文字写入到word中，只是格式略丑。但聊胜于无么。 pdf转word——文字版加入一个pdf是由文字组成的，我在网上找到了pdfminer3k这个模块来处理pd">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2018-03-31T03:02:37.062Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="python 解析pdf内容">
<meta name="twitter:description" content="今天一同学问我能不能帮他把pdf转word。我第一反应是告诉他有很多这样的线上工具，然后他告诉我说线上的转换工具只能转1页，剩下的要钱。呜呜呜~~。好吧，看看万能的python有什么库能帮助这位小哥哥。 果然我找到了一个库，可以将pdf中的文字写入到word中，只是格式略丑。但聊胜于无么。 pdf转word——文字版加入一个pdf是由文字组成的，我在网上找到了pdfminer3k这个模块来处理pd">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Mist',
    sidebar: {"position":"right","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://gitee.com/shuhao/2018/03/30/python-解析pdf内容/"/>





  <title> python 解析pdf内容 | Niki </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?cb9f0585e406f878cb2f29c89ad3cdb7";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










  
  
    
  

  <div class="container one-collumn sidebar-position-right page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Niki</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">天道酬勤</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/blog/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-categories"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/blog/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://gitee.com/shuhao/blog/2018/03/30/python-解析pdf内容/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Fang ShuHao">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/head.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Niki">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                python 解析pdf内容
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-03-30T13:31:49+08:00">
                2018-03-30
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/python/" itemprop="url" rel="index">
                    <span itemprop="name">python</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>今天一同学问我能不能帮他把pdf转word。我第一反应是告诉他有很多这样的线上工具，然后他告诉我说线上的转换工具只能转1页，剩下的要钱。呜呜呜~~。好吧，看看万能的python有什么库能帮助这位小哥哥。</p>
<p>果然我找到了一个库，可以将pdf中的文字写入到word中，只是格式略丑。但聊胜于无么。</p>
<h2 id="pdf转word——文字版"><a href="#pdf转word——文字版" class="headerlink" title="pdf转word——文字版"></a>pdf转word——文字版</h2><p>加入一个pdf是由文字组成的，我在网上找到了pdfminer3k这个模块来处理pdf， 使用python-docx 将文本写入到word文件中</p>
<p>首先安装 pdfminer3k， python-docx连个库<br><figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="keyword">from</span> pdfminer.pdfparser <span class="keyword">import</span> PDFParser, PDFDocument</span><br><span class="line"><span class="keyword">from</span> pdfminer.pdfinterp <span class="keyword">import</span> PDFResourceManager, PDFPageInterpreter, PDFTextExtractionNotAllowed</span><br><span class="line"><span class="keyword">from</span> pdfminer.layout <span class="keyword">import</span> LAParams</span><br><span class="line"><span class="keyword">from</span> pdfminer.converter <span class="keyword">import</span> PDFPageAggregator</span><br><span class="line"><span class="keyword">import</span> docx</span><br><span class="line"><span class="keyword">import</span> argparse</span><br><span class="line"><span class="keyword">import</span> os, time, re, sys</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">parse = argparse.ArgumentParser()</span><br><span class="line">parse.add_argument(<span class="string">"--filePath"</span>, help=<span class="string">"需要转换的绝对文件路径"</span>)</span><br><span class="line">parse.add_argument(<span class="string">"--outPath"</span>, help=<span class="string">"输出的word文档路径"</span>)</span><br><span class="line"></span><br><span class="line">args = parse.parse_args()</span><br><span class="line">filePath = args.filePath</span><br><span class="line">outWordPath = parse.outPath</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">d = filePath = os.path.dirname(__file__)</span><br><span class="line"><span class="keyword">if</span> (filePath == <span class="keyword">None</span>):</span><br><span class="line">    filePath = os.path.join(d, <span class="string">"demo.pdf"</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># 输出的word文档</span></span><br><span class="line"><span class="keyword">if</span> (outWordPath == <span class="keyword">None</span>):</span><br><span class="line">    filePath = os.path.join(d, <span class="string">"demo.pdf"</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">parseFDF</span><span class="params">()</span>:</span></span><br><span class="line">    <span class="keyword">with</span> open(filePath, <span class="string">'rb'</span>) <span class="keyword">as</span> fn:</span><br><span class="line">        print(<span class="string">"pdf路径：&#123;&#125;"</span>.format(filePath))</span><br><span class="line">        pdfParser = PDFParser(fn)</span><br><span class="line">        doc = PDFDocument()</span><br><span class="line">        pdfParser.set_document(doc)</span><br><span class="line">        doc.set_parser(pdfParser)</span><br><span class="line">        doc.initialize(<span class="string">""</span>)</span><br><span class="line">        <span class="keyword">if</span> <span class="keyword">not</span> doc.is_extractable:</span><br><span class="line">            <span class="keyword">raise</span> PDFTextExtractionNotAllowed</span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            resource = PDFResourceManager()</span><br><span class="line">            laparams = LAParams()</span><br><span class="line">            device = PDFPageAggregator(resource, laparams=laparams)</span><br><span class="line">            interpreter = PDFPageInterpreter(resource, device)</span><br><span class="line">            <span class="comment"># 内存中的doc</span></span><br><span class="line">            content = docx.Document()</span><br><span class="line">            <span class="keyword">for</span> page <span class="keyword">in</span> doc.get_pages():</span><br><span class="line">                interpreter.process_page(page)</span><br><span class="line">                layout = device.get_result()</span><br><span class="line"></span><br><span class="line">                <span class="keyword">for</span> out <span class="keyword">in</span> layout:</span><br><span class="line">                    <span class="keyword">if</span> hasattr(out, <span class="string">"get_text"</span>):</span><br><span class="line">                        text = out.get_text()</span><br><span class="line">                        print(text)</span><br><span class="line">                        content.add_paragraph(text)</span><br><span class="line">            content.save(outWordPath)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    <span class="keyword">pass</span></span><br></pre></td></tr></table></figure></p>
<h2 id="pdf转word——图片版"><a href="#pdf转word——图片版" class="headerlink" title="pdf转word——图片版"></a>pdf转word——图片版</h2><p>有的pdf文件并不是由文字组成，每张都是一张图片。所以pdf可能是图片组成那么我们就需要把pdf中所有的图片全部下载下来，然后读取图片中的文字，保存到word中。<br>这里，我们使用PyMuPDF库来读取pdf中的图片<br>然后通过pytesseract 和pIL库 以及 谷歌的识别引擎tesseract-ocr来读取图片中的文字<br>在将所有的图片的文字写到一个word中，这样就实现了把pdf转为word的过程</p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> os, re</span><br><span class="line"><span class="keyword">import</span> fitz</span><br><span class="line"><span class="keyword">import</span> argparse</span><br><span class="line"><span class="keyword">import</span> pytesseract</span><br><span class="line"><span class="keyword">from</span> PIL <span class="keyword">import</span> Image</span><br><span class="line"><span class="keyword">import</span> docx</span><br><span class="line"></span><br><span class="line"><span class="comment"># pdf内容转换到word，pdf内容为图片</span></span><br><span class="line"></span><br><span class="line">parser = argparse.ArgumentParser()</span><br><span class="line">parser.add_argument(<span class="string">"--filePath"</span>, help=<span class="string">"需要转换的绝对文件路径"</span>)</span><br><span class="line">parser.add_argument(<span class="string">"--outWordPath"</span>, help=<span class="string">"word文档的输出目录"</span>)</span><br><span class="line">args = parser.parse_args()</span><br><span class="line">filePath = args.filePath</span><br><span class="line">outWordPath = args.outWordPath</span><br><span class="line"></span><br><span class="line">d = os.path.dirname(__file__)</span><br><span class="line"><span class="keyword">if</span> (filePath == <span class="keyword">None</span>):</span><br><span class="line">    filePath = os.path.join(d, <span class="string">"demo.pdf"</span>)</span><br><span class="line"><span class="keyword">if</span> (outWordPath == <span class="keyword">None</span>):</span><br><span class="line">    outWordPath = os.path.join(d, <span class="string">"word.docx"</span>)</span><br><span class="line"></span><br><span class="line">checkXO = <span class="string">r"/Type(?= */XObject)"</span>  <span class="comment"># finds "/Type/XObject"</span></span><br><span class="line">checkIM = <span class="string">r"/Subtype(?= */Image)"</span>  <span class="comment"># finds "/Subtype/Image"</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">findImg</span><span class="params">()</span>:</span></span><br><span class="line">    print(filePath)</span><br><span class="line">    doc = fitz.open(filePath)</span><br><span class="line">    imgcount = <span class="number">0</span></span><br><span class="line">    lenXREF = doc._getXrefLength()</span><br><span class="line">    print(<span class="string">"file: %s, pages: %s, objects: %s"</span> % (filePath, len(doc), lenXREF - <span class="number">1</span>))</span><br><span class="line">    outWord = docx.Document(outWordPath)</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">1</span>, lenXREF):  <span class="comment"># scan through all objects</span></span><br><span class="line">        text = doc._getObjectString(i)  <span class="comment"># string defining the object</span></span><br><span class="line">        isXObject = re.search(checkXO, text)  <span class="comment"># tests for XObject</span></span><br><span class="line">        isImage = re.search(checkIM, text)  <span class="comment"># tests for Image</span></span><br><span class="line">        <span class="keyword">if</span> <span class="keyword">not</span> isXObject <span class="keyword">or</span> <span class="keyword">not</span> isImage:  <span class="comment"># not an image object if not both True</span></span><br><span class="line">            <span class="keyword">continue</span></span><br><span class="line">        imgcount += <span class="number">1</span></span><br><span class="line">        pix = fitz.Pixmap(doc, i)  <span class="comment"># make pixmap from image</span></span><br><span class="line">        <span class="keyword">if</span> pix.n &lt; <span class="number">5</span>:  <span class="comment"># can be saved as PNG</span></span><br><span class="line">            addTextToOutWord(pix, outWord, i)</span><br><span class="line">            <span class="keyword">pass</span></span><br><span class="line">        <span class="keyword">else</span>:  <span class="comment"># must convert the CMYK first</span></span><br><span class="line">            pix0 = fitz.Pixmap(fitz.csRGB, pix)</span><br><span class="line">            addTextToOutWord(pix, outWord, i)</span><br><span class="line">            </span><br><span class="line">            pix0 = <span class="keyword">None</span>  <span class="comment"># free Pixmap resources</span></span><br><span class="line">        pix = <span class="keyword">None</span>  <span class="comment"># free Pixmap resources</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 读取pdf中解析出来的图片，写入到最后的word中</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">addTextToOutWord</span><span class="params">(pix, outWord, i)</span>:</span></span><br><span class="line">    pix.writePNG(<span class="string">"img-%s.png"</span> % (i,))</span><br><span class="line">    text = readTextFromImg(<span class="string">"img-%s.png"</span> % (i,))</span><br><span class="line">    outWord.add_paragraph(text);</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">readTextFromImg</span><span class="params">(img_path)</span>:</span></span><br><span class="line">    text = pytesseract.image_to_string(Image.open(img_path), lang=<span class="string">'chi_sim'</span>)</span><br><span class="line">    <span class="keyword">return</span> text</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> (__name__ == <span class="string">"__main__"</span>):</span><br><span class="line">    findImg()</span><br></pre></td></tr></table></figure>
<h2 id="注意：在使用pytesseract库时报错解决"><a href="#注意：在使用pytesseract库时报错解决" class="headerlink" title="注意：在使用pytesseract库时报错解决"></a>注意：在使用pytesseract库时报错解决</h2><ol>
<li><p>FileNotFoundError:[WinError 2]系统找不到指定文件。</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">这个是因为pytesseract库运行时需要用到Google的Tesseract-OCR。所有在使用pytesseract之前，我们需要先安装Tesseract-OCR。然后打开pytesseract.py的源码，修改 tesseract_cmd = &apos;tesseract&apos; 这一行，将其路径设置为我们的tesseract的可执行文件路径。</span><br><span class="line">例如我的window环境路径为： tesseract_cmd = r&quot;D:\Program Files\Tesseract-OCR\tesseract.exe&quot;</span><br></pre></td></tr></table></figure>
</li>
<li><p>设置完之后，运行你会发现仍然报错：<br>Error opening data file \Program Files\Tesseract-OCR\chi_sim.traineddata<br>这是因为Tesseract-OCR找不到对应的语言包的路径。这是需要设置环境变量</p>
</li>
</ol>
<p>TESSDATA_PREFIX = DD:\Program Files\Tesseract-OCR\tessdata<br>在这个路径下，chi_sim.traineddata类型的文件就是我们的语言文件</p>
<blockquote>
<blockquote>
<blockquote>
<p>参考<br><a href="https://blog.csdn.net/Fighting_No1/article/details/51038942" target="_blank" rel="external">pdf提取文本</a><br><a href="http://blog.topspeedsnail.com/archives/9404" target="_blank" rel="external">pdf提取图片</a><br><a href="https://blog.csdn.net/qiushi_1990/article/details/78041375" target="_blank" rel="external">python读取图片中文字</a></p>
</blockquote>
</blockquote>
</blockquote>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/blog/tags/python/" rel="tag"># python</a>
          
            <a href="/blog/tags/pdf/" rel="tag"># pdf</a>
          
        </div>
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/2018/03/28/Mongo-GridFs文件服务/" rel="next" title="Mongo GridFs文件服务">
                <i class="fa fa-chevron-left"></i> Mongo GridFs文件服务
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/2018/04/03/Maven命令总结/" rel="prev" title="Maven命令总结">
                Maven命令总结 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>

          
          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zNjY5NS8xMzIzMA=="></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/blog/images/head.jpg"
               alt="Fang ShuHao" />
          <p class="site-author-name" itemprop="name">Fang ShuHao</p>
           
              <p class="site-description motion-element" itemprop="description"></p>
          
        </div>
        <nav class="site-state motion-element">
        
          
            <div class="site-state-item site-state-posts">
              <a href="/blog/archives">
                <span class="site-state-item-count">135</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-categories">
              <a href="/blog/categories">
                <span class="site-state-item-count">35</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/blog/tags">
                <span class="site-state-item-count">93</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#pdf转word——文字版"><span class="nav-number">1.</span> <span class="nav-text">pdf转word——文字版</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#pdf转word——图片版"><span class="nav-number">2.</span> <span class="nav-text">pdf转word——图片版</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#注意：在使用pytesseract库时报错解决"><span class="nav-number">3.</span> <span class="nav-text">注意：在使用pytesseract库时报错解决</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Fang ShuHao</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    
    
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  




  
  <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.0"></script>



  



  




	





  





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  



  
  

  

  

  

  


  

</body>
</html>
